import jakarta.servlet.annotation.WebServlet;
import jakarta.servlet.http.HttpServlet;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import  jakarta.servlet.ServletException;
import java.io.IOException;
import java.util.*;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
@WebServlet("/student")
public class StudentServlet extends HttpServlet {
    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws SecurityException, IOException, ServletException {
        List<Student> students = Arrays.asList(
                new Student(101,"zc"),
                new Student(102,"kk"),
                new Student(103,"lz"),
                new Student(104,"wm")
        );
        req.setAttribute("students", students);
        req.getRequestDispatcher("/student.jsp").forward(req,resp);
    }
}
